#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int arr[1000] = { 0 };

void bubble_sort(int arr[1000],int sz)
{
	for (int i = 0; i < sz - 1; i++)
	{
		for (int j = 0; j < sz-1; j++)
		{
			if (arr[j] > arr[j + 1])
			{
				int tmp = arr[j];
				arr[j] = arr[j + 1];
				arr[j + 1] = tmp;
			}
		}
	}
}

int main()
{
	int n; scanf("%d", &n);
	int m, k; scanf("%d%d", &m, &k);
	for (int i = 0; i < n; i++) arr[i] = i + 1;
	int sign = 1;
	int sub = 0;
	int human = 0;
	for (int i = n; i>1; i--)
	{
		if (sign % 2 == 1)
		{
			int j = (human+m-1) % i + 1;
			arr[sub+j-1] = 0;
			human = j - 1;
			bubble_sort(arr, n);
		}
		else
		{
			int j = (human+(i-k+2)-1) % i + 1;
			arr[sub+j-1] = 0;
			human = j-2;
			bubble_sort(arr, n);
		}
		sign++;
		sub++;
	}
	printf("%d\n", arr[n - 1]);
	return 0;
}